package com.example.back.service.impl;

import com.example.back.mapper.AreaDetailsMapper;
import com.example.back.model.AreaDetails;
import com.example.back.service.AreaDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
* @author jialily
* @description 针对表【t_area_details】的数据库操作Service实现
* @createDate 2022-04-25 17:36:06
*/
@Service("areaDetailsService")
//支持事务，增加，删除，更新操作单独使用 propagation = Propagation.SUPPORTS
@Transactional(propagation = Propagation.SUPPORTS,rollbackFor = Exception.class)
public class AreaDetailsServiceImpl implements AreaDetailsService{

    @Autowired
    AreaDetailsMapper areaDetailsMapper;

    public List<AreaDetails> selectAll() {
        return this.areaDetailsMapper.selectAll();
    }

    @Override
    public AreaDetails selectDetail(String itemId) {
        return this.areaDetailsMapper.selectDetail(itemId);
    }

    @Override
    public List<AreaDetails> search(String searchContent) {
        return this.areaDetailsMapper.search(searchContent);
    }

    @Override
    public AreaDetails selectArea(String areaname) {
        return this.areaDetailsMapper.selectArea(areaname);
    }

    @Override
    public int updateArea(int id, String name,String placedes,double ticket) {
        return this.areaDetailsMapper.updateArea(id,name,placedes,ticket);
    }

    @Override
    public int deleteArea(int id) {
        return this.areaDetailsMapper.deleteArea(id);
    }

    @Override
    public int insertArea(String name, String placedes, double ticket) {
        return this.areaDetailsMapper.insertArea(name,placedes,ticket);
    }

}
